/*
 * 	Additional function for tables.html
 *	Written by ThemePixels	
 *	http://themepixels.com/
 *
 *	Copyright (c) 2012 ThemePixels (http://themepixels.com)
 *	
 *	Built for Amanda Premium Responsive Admin Template
 *  http://themeforest.net/category/site-templates/admin-templates
 */

jQuery(document).ready(function(){
	jQuery('#postSalaryTable').dataTable({
		"sPaginationType": "full_numbers",
		"oLanguage": {
			"sLengthMenu": "每页显示 _MENU_ 条记录",
			"sZeroRecords": "抱歉， 没有找到",
			"sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
			"sInfoEmpty": "没有数据",
			"sInfoFiltered": "(从 _MAX_ 条数据中检索)",
			"sSearch":"全文搜索:",
			"oPaginate": {
			"sFirst": "首页",
			"sPrevious": "前一页",
			"sNext": "后一页",
			"sLast": "尾页",
			},
			"sZeroRecords": "没有检索到数据",
			"sProcessing": "<img src='./loading.gif' />"
		}
	});
});



function confirmDelete(id) {
	jConfirm('你确定要删除 该条工资结构吗?', '删除工资结构', function(r) {
		if(r) {
			jQuery.ajax({
				   type: "post",
				   url: "/postSalary/delete",
				   dataType:"json",
				   data: {postSalaryId: id},
				   success: function(data){
					   if(data.flag == true) {
						   	window.location.reload();
						   	jQuery.jGrowl("恭喜您，删除工资结构成功！");
					   }else {
						   jQuery.jGrowl("很抱歉，删除工资结构失败！");
					   }
				   },
					error:function(e) {  
						jQuery.jGrowl("很抱歉，删除工资结构失败！");
			        }
				 });
		}
	});
	return false;
};
